package com.takeshi.landlords.util;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;

public interface DoubleList<E>{
    //-1下标：代表没有这个元素
    static final int ELEMENT_NOT_FOUND = -1;

    void clear();

    int size();

    boolean isEmpty();

    boolean contains(E element);

    void foreach(Consumer<? super E> action);

    E find(Predicate<? super E> predicate);

    E findPrev(Predicate<? super E> predicate);

    E findNext(Predicate<? super E> predicate);

    void add(E element);

    E get(int index);

    void add(int index, E element);

    E remove(int index);

    int indexOf(E element);

    List<E> toList();

}